<?php
/*
	插件概览
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
$id=intval($_RQ['id']);
if($id){
	$_SESSION['storeid']=$id;
}
if(!$_SESSION['storeid']){
	$_SESSION['storeid']=$_SESSION['storeids'][0];
	//exi('请先选择门店！','error');
}
if($_SESSION['juese_id']==15 && !$_SESSION['istostore']){
	$_SESSION['istostore']=1;;
}
if($_RQ['op']=='get'){
	//显示统计数据
	$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
	$new['dingjin']=pdo_count('jy_yxw_infee_log',array('type'=>2,'storeid'=>$_SESSION['storeids']?:$_SESSION['storeid'],'uniacid'=>$_SESSION['uniacid'],'status'=>1));
	$new['dingjinday']=pdo_count('jy_yxw_infee_log',array('jiao_time >'=>$daytime,'type'=>2,'storeid'=>$_SESSION['storeids']?:$_SESSION['storeid'],'uniacid'=>$_SESSION['uniacid'],'status'=>1));
	$new['buygoods']=pdo_count('jy_yxw_infee_log',array('type'=>1,'storeid'=>$_SESSION['storeids']?:$_SESSION['storeid'],'uniacid'=>$_SESSION['uniacid'],'status'=>1));
	$new['buygoodsday']=pdo_count('jy_yxw_infee_log',array('jiao_time >'=>$daytime,'type'=>1,'storeid'=>$_SESSION['storeids']?:$_SESSION['storeid'],'uniacid'=>$_SESSION['uniacid'],'status'=>1));
	$new['tuifee']=pdo_count('jy_yxw_tuifee_log',array('type'=>array(0,1),'status'=>4,'storeid'=>$_SESSION['storeids']?:$_SESSION['storeid'],'uniacid'=>$_SESSION['uniacid']));
	$new['tuifeeday']=pdo_count('jy_yxw_tuifee_log',array('tuidaytime >'=>$daytime,'type'=>array(0,1),'status'=>4,'storeid'=>$_SESSION['storeids']?:$_SESSION['storeid'],'uniacid'=>$_SESSION['uniacid']));
	$new['yuke']=pdo_count('jy_yxw_member',array('uniacid'=>$_SESSION['uniacid'],'storeid'=>$_SESSION['storeids']?:$_SESSION['storeid'],'status'=>10));
	$new['yukeday']=pdo_count('jy_yxw_member',array('ti7_time >'=>$daytime,'uniacid'=>$_SESSION['uniacid'],'storeid'=>$_SESSION['storeids']?:$_SESSION['storeid'],'status'=>10));
	$htmls=array(
		array('type'=>'data','num'=>12,'one_num'=>3,'title'=>'今日/总数据','datas'=>array(
			array('title'=>'交定金用户','num'=>2,'data'=>array($new['dingjinday'],$new['dingjin'])),
			array('title'=>'成交用户','num'=>2,'data'=>array($new['buygoodsday'],$new['buygoods'])),
			array('title'=>'退成交用户','num'=>2,'data'=>array($new['tuifeeday'],$new['tuifee'])),
			array('title'=>'售后试用用户(已成交未分售后群的用户数量)','num'=>2,'data'=>array($new['yukeday'],$new['yuke'])),
		)),
	);
	$return['htmls']=$htmls;
	exi($return);
}